<table width="100%"><tr><td width="20%">
<a href="../index.html">&lt; index</a><br />
<a href="index.html">&lt; 5. Image toolkit</a>
</td><td width="60%">
<p align="center">
=====================================<br />
5.1 Creating an empty image<br />
=====================================<br />
</p></td><td width="20%">
</td></tr></table>
<style type="text/css">
.code { color:#444444; background-color:#EEEEEE;}
pre { color:#444444; background-color:#EEEEEE;}
table.param td { border : 1px solid #000000; }
th { background-color: #44BBFF; color: #FFFFFF }
table.none td { border : 0 }
</style>
You can create an image of any size, filled with the root console's background color or with black if the root console is not initialized, with :<br/>
<p class="code"><pre>
C++ : TCODImage::TCODImage(int width, int height)
C   : TCOD_image_t TCOD_image_new(int width, int height)
Py  : image_new( width, height)
</pre></p>
<table class="param">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td>width, height</td><td>Size of the image in pixels.</td></tr>
</table>
Example :<br />
<p class="code"><pre>
C++ : TCODImage *pix = new TCODImage(80,50);
C   : TCOD_image_t pix = TCOD_image_new(80,50);
Py  : pix = litbcod.image_new(80,50)
</pre></p>
